/*
 * Amkai Enterprise Solution (AES.) 
 * Copyright 2004 by Amkai(TM), Inc.
 * www.amkai.com
 * 
 * Project: webservice
 * Package: com.amkai.aes.webservice.binary.objecthandler.init
 * File: RadBeanInitializationHandler.java
 * Created: Feb 14, 2006 1:11:29 PM
 * Author: johnny 
 * 
 */
package com.amkai.aes.webservice.binary.objecthandler.init;

import java.io.Serializable;

import com.amkai.aes.aescommon.service.binary.job.init.InitializationJob;
import com.amkai.aes.aescommon.service.result.init.InitializationResult;
import com.amkai.aes.server.hibernate.beaninitialization.RADBeanInitialization;
import com.amkai.aes.webservice.binary.JobObjectHandler;

/**
 * RadBeanInitializationHandler
 * @author johnny
 * Description:
 *
 */
public class RadBeanInitializationHandler implements JobObjectHandler<InitializationJob, Serializable, InitializationResult> {

	/** 
	 * Overriden method
	 * @param job
	 * @param object
	 * @return
	 * @throws Exception
	 * @see com.amkai.aes.webservice.binary.JobObjectHandler#process(E, InputObject)
	 * 
	 */
	public InitializationResult process(InitializationJob job, Serializable object) throws Exception {
		RADBeanInitialization init = new RADBeanInitialization(job.getId(), job.getClazz(), job.getProperties());
		Serializable bean = init.execute();
		InitializationResult result = new InitializationResult();
		result.setRadBean(bean);
		return result;
	}

}
